package org.dsun.json.bean;

import java.util.ArrayList;
import java.util.Collection;

/**
 * 雄关漫道真如铁，而今迈步从头越。
 * @author donga
 * @version 1.0
 * @since 201-8-15
 */
public class ValueList extends ArrayList<JsonValue> {
	
	private static final long serialVersionUID = -6725567378641002670L;

	public ValueList(){
		super();
	}
	
	public ValueList(Collection<JsonValue> c){
		super(c);
	}
	
	public ValueList(int initialCapacity){
		super(initialCapacity);
	}
	
	@Override
	public String toString(){
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<this.size();i++){
			sb.append(get(i)).append(',');
		}
		if(sb.length()==0){
			return "[]";
		}else{
			sb.insert(0, '[');
			sb.replace(sb.length()-1,sb.length(), "]");
			return sb.toString();
		}
	}
}
